package com.endurance.feign;

import com.endurance.fallback.ProductFallback;
import com.endurance.po.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.HashMap;

@Component
@FeignClient(value = "PRODUCT" , fallback = ProductFallback.class)
public interface ProductClients {
    // 调用部门的哪个接口？
    @GetMapping("/product/findAll")
    public HashMap findAll();

    @GetMapping("/product/get/variable")
    public HashMap method1(@RequestParam String name);

    @GetMapping("/product/get/obj")
    public HashMap method2(Product product);

    @PostMapping("/product/post/variable")
    public HashMap method3(@RequestParam("name") String name);

    @PostMapping("/product/post/obj")
    public HashMap method4(@RequestBody Product product);

}
